package com.codedef.diaryserver.controller;

import com.codedef.diaryserver.domain.DiaryDao;
import com.codedef.diaryserver.domain.UserDao;
import com.codedef.diaryserver.service.UserService;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @GetMapping("/info")
    public UserDao getUserInfo() {
        UserDao userDao = userService.getUserInfo();
        userDao.setPassword(null);
        return userDao;
    }


}
